<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<script>
function a(color){
    document.body.style.backgroundColor=color;

}



</script>
<body>
    <button onclick="a('red')">红色</button>
    <button onclick="a('blue')">蓝色</button>
    <button onclick="a('yellow')">黄色</button>
    
</body>
</html>